package com.press.services;

import com.press.bean.OptionBean;
import com.press.bean.UserBean;
import com.press.mapper.InitOptionMapper;
import com.press.mapper.SetMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by LENOVO on 2016/10/14.
 */
@Service("setService")
public class SetService {
    @Resource(name = "initOptionMapper")
    private InitOptionMapper initOptionMapper;
    @Resource(name = "setMapper")
    private SetMapper setMapper;

    //评论设置
    public boolean allow_not_login(){
        return false;
    }


   //常规设置中设置站点名称
    public boolean setName(String web_name){
        return setMapper.setName(web_name);
    }

    //常规设置中设置管理员信息
    public  UserBean adminSet(UserBean userBean){
        if(setMapper.adminSet(userBean)){
            return setMapper.getUserById(userBean.getUser_id());
        }else {
            return null;
        }
    }

    public SetMapper getSetMapper() {
        return setMapper;
    }

    public void setSetMapper(SetMapper setMapper) {
        this.setMapper = setMapper;
    }

    public InitOptionMapper getInitOptionMapper() {
        return initOptionMapper;
    }

    public void setInitOptionMapper(InitOptionMapper initOptionMapper) {
        this.initOptionMapper = initOptionMapper;
    }
}
